<?php
//$myArr = array(3,2,5,1,9,6,8,7);
//for ($i = 0; $i < count($myArr); $i++) {
//    for ($j = $i+1; $j < count($myArr); $j++) {
//        if($myArr[$j]<$myArr[$i]){
//            $temp = $myArr[$j];
//            $myArr[$j] = $myArr[$i];
//            $myArr[$i] = $temp;
//        }
//    }
//}
//print_r($myArr);

//$dirname = dirname(__FILE__);
//$dir = new DirectoryIterator($dirname);
//foreach ($dir as $value) {
//    $filename = $value->getFilename();
//echo <<<EOT
//   <a href="$filename">$filename</a><br/>
//EOT;
//    //echo $value->getFilename().'<br/>';
//    
//}

$dbname = 'ron_website';
$hostname = 'localhost';
$username = 'root';
$passwd = '123456';
$dsn = 'mysql:dbname='.$dbname.';hostname='.$hostname;
try{
    $dbh = new PDO($dsn, $username, $passwd);
}  catch (PDOException $error){
    echo 'Cannot connect database:'.$error->getMessage();
}

//$sql = 'SELECT * FROM ron_account WHERE id = (SELECT max(id) FROM ron_account)';
//$sql = 'CREATE TABLE test(id int,name varchar(24))';
$sql = 'DROP IF EXISTS TABLE test';
$sth = $dbh->prepare($sql);
$sth->execute();
//while($result = $sth->fetch()){
//    print_r($result).'<br/>';
//};

?>
